{include file="common/_header"}

<body>

    <div class="x-body layui-anim layui-anim-up">
        <form class="layui-form">
            <input type="hidden" name="group_id" value="{$data.group_id|default=0}">

            <div class="div_input">
                <div class="div_left div_inline">用户组名称：</div>
                <div class="div_right div_inline">
                    <input type="text" name="group_name" placeholder="请输入" width="300px" value="{$admin.group_name}" autocomplete="off" class="layui-input">
                </div>
            </div>


            <div style="margin-top: 30px; margin-right: 20px; text-align: right">
                <button type="button" lay-submit lay-filter="add" class="layui-btn" >立即提交</button>
            </div>
        </form>
    </div>
</body>

<script>
    layui.use('form', function(){
        var form = layui.form;


        form.on('submit(add)', function (data) {
            $.ajax({
                'url': 'boxegroup',
                'type': 'post',
                'data': data.field,
                'dataType': 'json',
                success: function (data) {
                    if(data.code == 1){
                        layer.msg(data.msg, {
                            icon: 6,
                            time: 800,
                        },function () {
                            window.parent.location.href = data.url;
                        })
                    }
                }
            });
        })
    });

</script>

{include file="common/_bottom"}